@include('admin.header')
<style>
  .search_product {
    max-height:248px;
    overflow-y: scroll;
  }
  .search_product > .item {
    width:80px;
    margin-right:5px;
    float:left;
  }
  .search_product > .item img {
    height:80px;
  }
  .search_product > .item .name {
    height:20px;
    overflow:hidden;
  }
  .order_info {
    display: block;
    margin-top: 5px;
  }
  .line {
    border: 3px dashed #ccc;
    margin-top: 10px;
    margin-bottom: 20px;
  }
</style>
<div class="margin-top-20">
  <form method="post" class="form-horizontal js-ajax-form direct_add_form" action="/globalexchange/direct_add_submit" novalidate="novalidate" enctype ="multipart/form-data">
    <fieldset>
      <!-- **********************用户基本信息********************** -->
      <!-- 用户ID号 -->
      <div class="control-group"><label class="control-label">用户ID号</label>
        <div class="controls">
          <span class="order_info">{{$user_info->nodeid}}</span>
        </div>
      </div>
      <!-- 头像 -->
      <div class="control-group"><label class="control-label">头像</label>
        <div class="controls">
          @if(!empty($user_info->photourl))
            <img src="{{$user_info->photourl}}" style="height:80px;" />
          @endif
        </div>
      </div>
      <!-- 用户账号 -->
      <div class="control-group"><label class="control-label">用户账号</label>
        <div class="controls">
          <span class="order_info">{{$user_info->nodecode}}</span>
        </div>
      </div>
      <!-- 用户名 -->
      <div class="control-group"><label class="control-label">用户名</label>
        <div class="controls">
          <span class="order_info">{{$user_info->nodename}}</span>
        </div>
      </div>
      <!-- 邮箱 -->
      <div class="control-group"><label class="control-label">邮箱</label>
        <div class="controls">
          <span class="order_info">{{$user_info->email}}</span>
        </div>
      </div>
      <!-- 是否认证 -->
      <div class="control-group"><label class="control-label">是否实名认证</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->isconfirmed == 1)
              是
            @else
              否
            @endif
          </span>
        </div>
      </div>
      <!-- 推荐人 -->
      <div class="control-group"><label class="control-label">推荐人</label>
        <div class="controls">
          <span class="order_info">
            @if(isset($user_info->parent_name))
              {{$user_info->parent_name}}
            @else
              暂无
            @endif
          </span>
        </div>
      </div>
      <!-- 注册时间 -->
      <div class="control-group"><label class="control-label">注册时间</label>
        <div class="controls">
          <span class="order_info">{{$user_info->createtime}}</span>
        </div>
      </div>
      <!-- 用户状态 -->
      <div class="control-group"><label class="control-label">用户状态</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->status == 0)
              未激活
            @elseif($user_info->status == 1)
              已激活
            @elseif($user_info->status == 2)
              已注销
            @elseif($user_info->status == 3)
              已封锁
            @endif
          </span>
        </div>
      </div>
      <!-- 实名验证时间 -->
      <div class="control-group"><label class="control-label">实名验证时间</label>
        <div class="controls">
          <span class="order_info">{{$user_info->authtime}}</span>
        </div>
      </div>
      <!-- 用户等级 -->
      <div class="control-group"><label class="control-label">用户等级</label>
        <div class="controls">
          <span class="order_info">{{$user_info->nodelevel}}</span>
        </div>
      </div>
      <!-- 数据来源 -->
      <div class="control-group"><label class="control-label">数据来源</label>
        <div class="controls">
          <span class="order_info">
            @if(is_null($user_info->data_source) || $user_info->data_source == 1)
              普通用户
            @elseif($user_info->data_source == 3)
              系统用户
            @elseif($user_info->data_source == 44)
              运营中心
            @elseif($user_info->data_source == 45)
              服务中心
            @endif
          </span>
        </div>
      </div>

      <!-- 分割线 -->
      <div class="line"></div>

      <!-- **********************身份证信息********************** -->
      @if($user_info->identity_id)
      <!-- 身份证ID号 -->
      <div class="control-group"><label class="control-label">身份证ID号</label>
        <div class="controls">
          <span class="order_info">{{$user_info->identity_id}}</span>
        </div>
      </div>
      <!-- 身份证名 -->
      <div class="control-group"><label class="control-label">身份证名</label>
        <div class="controls">
          <span class="order_info">{{$user_info->identity_name}}</span>
        </div>
      </div>
      <!-- 身份证编号 -->
      <div class="control-group"><label class="control-label">身份证编号</label>
        <div class="controls">
          <span class="order_info">{{$user_info->identity_no}}</span>
        </div>
      </div>
      <!-- 生日 -->
      <div class="control-group"><label class="control-label">生日</label>
        <div class="controls">
          <span class="order_info">{{$user_info->birthday}}</span>
        </div>
      </div>
      <!-- 性别 -->
      <div class="control-group"><label class="control-label">性别</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->sex == 0)
              女
            @else
              男
            @endif
          </span>
        </div>
      </div>
      <!-- 民族 -->
      <div class="control-group"><label class="control-label">民族</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->nation)
              {{$user_info->nation}}
            @else
              暂无
            @endif
          </span>
        </div>
      </div>
      <!-- 有效期开始时间 -->
      <div class="control-group"><label class="control-label">有效期开始时间</label>
        <div class="controls">
          <span class="order_info">{{$user_info->begin_time}}</span>
        </div>
      </div>
      <!-- 有效期结束时间 -->
      <div class="control-group"><label class="control-label">有效期结束时间</label>
        <div class="controls">
          <span class="order_info">{{$user_info->end_time}}</span>
        </div>
      </div>
      <!-- 签发机关 -->
      <div class="control-group"><label class="control-label">签发机关</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->issuing)
              {{$user_info->issuing}}
            @else
              暂无
            @endif
          </span>
        </div>
      </div>
      <!-- 身份证状态 -->
      <div class="control-group"><label class="control-label">身份证状态</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->identity_status == 0)
              禁用
            @elseif($user_info->identity_status == 1)
              正常
            @elseif($user_info->identity_status == 2)
              删除
            @endif
          </span>
        </div>
      </div>
      <!-- 地址 -->
      <div class="control-group"><label class="control-label">地址</label>
        <div class="controls">
          <span class="order_info">
            @if($user_info->address)
              {{$user_info->address}}
            @else
              暂无
            @endif
          </span>
        </div>
      </div>
      <!-- 证件头像 -->
      <div class="control-group"><label class="control-label">证件头像</label>
        <div class="controls">
          @if(!empty($user_info->head_photo))
            <img src="{{$user_info->head_photo}}" style="height:80px;" />
          @endif
        </div>
      </div>
      <!-- 身份证正面图 -->
      <div class="control-group"><label class="control-label">身份证正面图</label>
        <div class="controls">
          @if(!empty($user_info->front_photo))
            <img src="{{$user_info->front_photo}}" style="height:80px;" />
          @endif
        </div>
      </div>
      <!-- 身份证反面图 -->
      <div class="control-group"><label class="control-label">身份证反面图</label>
        <div class="controls">
          @if(!empty($user_info->back_photo))
            <img src="{{$user_info->back_photo}}" style="height:80px;" />
          @endif
        </div>
      </div>
      <!-- 身份证验证时间 -->
      <div class="control-group"><label class="control-label">身份证验证时间</label>
        <div class="controls">
          <span class="order_info">{{$user_info->identity_time}}</span>
        </div>
      </div>

      <!-- 分割线 -->
      <div class="line"></div>
      @endif

      <!-- **********************银行卡信息********************** -->
      @foreach($user_info->bank_info as $bank)
      <!-- 银行卡ID号 -->
      <div class="control-group"><label class="control-label">银行卡ID号</label>
        <div class="controls">
          <span class="order_info">{{$bank->bank_id}}</span>
        </div>
      </div>
      <!-- 银行卡账号 -->
      <div class="control-group"><label class="control-label">银行卡账号</label>
        <div class="controls">
          <span class="order_info">{{$bank->card_no}}</span>
        </div>
      </div>
      <!-- 开户用户姓名 -->
      <div class="control-group"><label class="control-label">开户用户姓名</label>
        <div class="controls">
          <span class="order_info">{{$bank->account_name}}</span>
        </div>
      </div>
      <!-- 银行名称 -->
      <div class="control-group"><label class="control-label">银行名称</label>
        <div class="controls">
          <span class="order_info">{{$bank->bank_name}}</span>
        </div>
      </div>
      <!-- 支行名称 -->
      <div class="control-group"><label class="control-label">支行名称</label>
        <div class="controls">
          <span class="order_info">{{$bank->branch_bank}}</span>
        </div>
      </div>
      <!-- 开户省份 -->
      <div class="control-group"><label class="control-label">开户省份</label>
        <div class="controls">
          <span class="order_info">{{$bank->province_name}}</span>
        </div>
      </div>
      <!-- 开户城市 -->
      <div class="control-group"><label class="control-label">开户城市</label>
        <div class="controls">
          <span class="order_info">{{$bank->city_name}}</span>
        </div>
      </div>
      <!-- 账户类型 -->
      <div class="control-group"><label class="control-label">账户类型</label>
        <div class="controls">
          <span class="order_info">
            @if($bank->account_type == 1)
              个人账号
            @elseif($bank->account_type == 2)
              企业账号
            @endif
          </span>
        </div>
      </div>
      <!-- 银行卡状态 -->
      <div class="control-group"><label class="control-label">银行卡状态</label>
        <div class="controls">
          <span class="order_info">
            @if($bank->status == 0)
              审核中
            @elseif($bank->status == 1)
              审核失败
            @elseif($bank->status == 2)
              审核通过
            @elseif($bank->status == 4)
              删除
            @endif
          </span>
        </div>
      </div>
      <!-- 银行联行号 -->
      <div class="control-group"><label class="control-label">银行联行号</label>
        <div class="controls">
          <span class="order_info">{{$bank->bank_num}}</span>
        </div>
      </div>
      <!-- 银行卡创建时间 -->
      <div class="control-group"><label class="control-label">银行卡创建时间</label>
        <div class="controls">
          <span class="order_info">{{$bank->createtime}}</span>
        </div>
      </div>
      <!-- 分割线 -->
      <div class="line"></div>
      @endforeach

      <!-- **********************钱包信息********************** -->
      @foreach($user_info->purse_info as $purse)
      <!-- 钱包ID号 -->
      <div class="control-group"><label class="control-label">钱包ID号</label>
        <div class="controls">
          <span class="order_info">{{$purse->purseid}}</span>
        </div>
      </div>
      <!-- 钱包类型 -->
      <div class="control-group"><label class="control-label">钱包类型</label>
        <div class="controls">
          <span class="order_info">
            @if($purse->pursetype == 1)
              收益钱包
            @elseif($purse->pursetype == 2)
              现金钱包
            @elseif($purse->pursetype == 3)
              积分账户
            @elseif($purse->pursetype == 97)
              授信账户
            @elseif($purse->pursetype == 98)
              中央银行钱包
            @elseif($purse->pursetype == 99)
              系统收益钱包
            @endif
          </span>
        </div>
      </div>
      <!-- 子钱包 -->
      <div class="control-group"><label class="control-label">子钱包</label>
        <div class="controls">
          <span class="order_info">
            @if($purse->subid == 2)
              购物积分
            @elseif($purse->subid == 4)
              GA积分
            @elseif($purse->subid == 5)
              惠民积分
            @elseif($purse->subid == 6)
              公益积分
            @elseif($purse->subid == 7)
              幸运积分
            @endif
          </span>
        </div>
      </div>
      <!-- 钱包余额 -->
      <div class="control-group"><label class="control-label">钱包余额</label>
        <div class="controls">
          <span class="order_info">{{$purse->balance}}元</span>
        </div>
      </div>
      <!-- 最小金额 -->
      <div class="control-group"><label class="control-label">最小金额</label>
        <div class="controls">
          <span class="order_info">{{$purse->minvalue}}元</span>
        </div>
      </div>
      <!-- 拥有者类型 -->
      <div class="control-group"><label class="control-label">拥有者类型</label>
        <div class="controls">
          <span class="order_info">
            @if($purse->ownertype == 1)
              个人钱包
            @elseif($purse->ownertype == 2)
              商店钱包
            @elseif($purse->ownertype == 99)
              系统钱包
            @endif
          </span>
        </div>
      </div>
      <!-- 冻结金额 -->
      <div class="control-group"><label class="control-label">冻结金额</label>
        <div class="controls">
          <span class="order_info">{{$purse->freezevalue}}</span>
        </div>
      </div>
      <!-- 钱包状态 -->
      <div class="control-group"><label class="control-label">钱包状态</label>
        <div class="controls">
          <span class="order_info">
            @if($purse->status == -1)
              全部禁止
            @elseif($purse->status == 0)
              全部容许
            @elseif($purse->status == 1)
              禁止进账
            @elseif($purse->status == 2)
              禁止出账
            @elseif($purse->status == 4)
              禁止冻结
            @elseif($purse->status == 8)
              禁止解冻
            @endif
          </span>
        </div>
      </div>
      <!-- 钱包编码 -->
      <div class="control-group"><label class="control-label">钱包编码</label>
        <div class="controls">
          <span class="order_info">{{$purse->purse_code}}</span>
        </div>
      </div>

      <!-- 分割线 -->
      <div class="line"></div>
      @endforeach
    </fieldset>
  </form>
</div>

<script>
	$(function () {
		$('.direct_add_form').submit(function(){
			var $t = $(this),action=$t.attr('action'),data = $t.serialize();
			post(action,data,function(data){
				_alert('处理成功',function(){
					parent.location.reload();
					parent.layer.close(parent.layer_open2);
        });
      });
			return false;
    });
	});
	
	function product_add(product_id){
		var $t = $('[name=product_id]'),val = $t.val(),vals = val.split(',');
		product_id = product_id + '';
		if(vals.length == 1){
			if(vals[0] == '')
			  vals = [];
        }
		if($.inArray(product_id,vals) === -1){
			vals.push(product_id);
			val = vals.join(',');
        }
		$t.val(val);
    }
</script>